/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package wf.model;

import bc.swing.pfrm.Model;
import bc.swing.pfrm.ano.PageDef;
import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

/**
 *
 * @author bennyl
 */
@DatabaseTable(tableName="plcs")
public class PLC{

   
    @DatabaseField(id=true)
    private String ip = "";

    @DatabaseField(canBeNull=false)
    private String name;

    public PLC(String ip, String name) {
        this.ip = ip;
        this.name = name;
    }

    public PLC() {
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return getName();
    }

    @Override
    public boolean equals(Object obj) {
        return obj != null && obj instanceof PLC && ((PLC)obj).getIp().equals(getIp());
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 59 * hash + (this.ip != null ? this.ip.hashCode() : 0);
        return hash;
    }

    
    
    
    
}
